When the following bug occurs
Importing matplotlib. pyplot as plt # The import of matplotlib before numpy and pandas can easily cause problems.
Import numpy as ns
import pandas as pd
import seaborn as sns

Changing to the following may solve the problem
Import numpy as ns
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt


File "/Users/hxw/Library/Developer/CoreSimulator/Devices/1A6FC9A9-DA48-43A7-A6F5-92C6B9EDD350/data/Containers/Bundle/Application/0F35F23D-3EA0-4B04-9456-F3CE304AD9DD/YingZhiPython3Pay.app/scripts/Lib/site-packages/numpy/linalg/_linalg.py", line 43, in <module>
    class EigResult(NamedTuple):
        eigenvalues: NDArray[Any]
        eigenvectors: NDArray[Any]
  File "/Users/hxw/Library/Developer/CoreSimulator/Devices/1A6FC9A9-DA48-43A7-A6F5-92C6B9EDD350/data/Containers/Bundle/Application/0F35F23D-3EA0-4B04-9456-F3CE304AD9DD/YingZhiPython3Pay.app/scripts/Lib/site-packages/numpy/linalg/_linalg.py", line 44, in EigResult
    eigenvalues: NDArray[Any]
                 ~~~~~~~^^^^^
TypeError: descriptor '__typing_prepare_subst__' for 'typing.TypeVar' objects doesn't apply to a 'types.GenericAlias' object